<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no" />
    <meta name="renderer" content="webkit">
    <meta name="keywords" content="{$navCur.keywords}"/>
    <meta name="description" content="{$navCur.description}"/>
    <title>{$navCur.seotitle}_{$config.site_name}</title>
    <link rel="stylesheet" href="__CDN__/assets/addons/wwh/css/swiper.min.css">
    <link rel="stylesheet" href="__CDN__/assets/addons/wwh/css/style.css">
    <link rel="stylesheet" href="__CDN__/assets/addons/wwh/css/media.css">
    <link rel="stylesheet" href="__CDN__/assets/addons/wwh/css/animate.min.css">
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/jquery.min.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/swiper.min.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/style.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/wow.min.js"></script>
    <script type="text/javascript" src="__CDN__/assets/addons/wwh/js/index.js"></script>
    <link rel="shortcut icon" href="__CDN__/assets/addons/wwh/images/favicon.ico">
</head>
<body>
<!--头部-->
{include file="header" /}
<!--内容-->
<div id="bann" style="background-image: url({$config.banner5|cdnurl});">
    <div class="container">
        <div class="t1 wow fadeInUp" data-wow-delay="200ms">
            {$config.ban5_t1}<br>
        </div>
        <div class="t2 wow fadeInUp" data-wow-delay="300ms">
            <span>{$config.ban5_t2}</span>
        </div>
    </div>
</div>

<div class="nav_pc hide wow fadeInLeft" data-wow-delay="400ms">
    <div class="container">
        <a class="home" href="{:addon_url('wwh/index/index')}"><img src="__CDN__/assets/addons/wwh/images/home_ico.png" style="background-color: #0f6ab4;" alt=""></a>
        <div class="first">
            <h4>{if condition="($navCur.parent_id == '0')"} {$navCur.name} {else /} {$top.name} {/if}</h4>
            <ul>
                {volist name="nav" id="v"}
                {if condition="($v.classify == 'about') OR ($v.type == 'link')"}
                {else /}
                <li><a href="{:addon_url('wwh/index/column', [':diyname'=>$v.diyname])}">{$v.name}</a></li>
                {/if}
                {/volist}
            </ul>
        </div>
        <div class="second active">
            <h4>
                {if condition="($navCur.parent_id == '0')"}公司概况{else /}{$navCur.name}{/if}
            </h4>
            <ul>
                {volist name="nav" id="v"}
                {if condition="($v.classify == 'about')"}
                {volist name="v.childlist" id="vv"}
                <li><a href="{:addon_url('wwh/index/column', [':diyname'=>$vv.diyname])}">{$vv.name}</a></li>
                {/volist}
                {else /}
                {/if}
                {/volist}
            </ul>
        </div>
    </div>
</div>
<div class="nav_phone hide container ">
    {volist name="nav" id="v"}
    {if condition="($v.classify == 'about') OR ($v.type == 'link')"}
    <p><a href="{:addon_url('wwh/index/column', [':diyname'=>$v.diyname])}">{$v.name}</a></p>
    {else /}
    {/if}
    {/volist}
    {if condition="($navCur.parent_id == '0')"}
    <p><a href="{:addon_url('wwh/index/column', [':diyname'=>$navCur.diyname])}">公司概况</a></p>
    {else /}
    <p><a href="{:addon_url('wwh/index/column', [':diyname'=>$navCur.diyname])}">{$navCur.name}</a></p>
    {/if}
</div>

<div id="contact">
    <div class="container">
        <div class="contact-box">
            <div class="address-items">
                <div class="item wow fadeInUp" data-wow-delay="100ms">
                    <div class="img">
                    <img src="__CDN__/assets/addons/wwh/images/tel1.png" alt="">
                    <img src="__CDN__/assets/addons/wwh/images/tel2.png" alt="">
                    </div>
                    <p class="t1">总机</p>
                    <p class="desc">{$contact.tel}</p>
                </div>
                <div class="item wow fadeInUp" data-wow-delay="200ms">
                    <div class="img">
                        <img src="__CDN__/assets/addons/wwh/images/fax1.png" alt="">
                        <img src="__CDN__/assets/addons/wwh/images/fax2.png" alt="">
                    </div>
                    <p class="t1">传真</p>
                    <p class="desc">{$contact.fax}</p>
                </div>
                <div class="item wow fadeInUp" data-wow-delay="300ms">
                    <div class="img">
                        <img src="__CDN__/assets/addons/wwh/images/mail1.png" alt="">
                        <img src="__CDN__/assets/addons/wwh/images/mail2.png" alt="">
                    </div>
                    <p class="t1">邮箱</p>
                    <p class="desc">{$contact.email}</p>
                </div>
                <div class="item wow fadeInUp" data-wow-delay="400ms">
                    <div class="img">
                        <img src="__CDN__/assets/addons/wwh/images/time1.png" alt="">
                        <img src="__CDN__/assets/addons/wwh/images/time2.png" alt="">
                    </div>
                    <p class="t1">工作时间</p>
                    <p class="desc">{$contact.time}</p>
                </div>
                <div class="item wow fadeInUp" data-wow-delay="500ms">
                    <div class="img">
                        <img src="__CDN__/assets/addons/wwh/images/add1.png" alt="">
                        <img src="__CDN__/assets/addons/wwh/images/add2.png" alt="">
                    </div>
                    <p class="t1">地址</p>
                    <p class="desc">{$contact.address}</p>
                </div>
            </div>

            <div class="map-box wow fadeInUp" data-wow-delay="600ms">
                <div id="map"></div>
            </div>

        <div class="message-box" id="message">
            <div class="title wow fadeInUp" data-wow-delay="200ms"><span>客户留言</span>欢迎给我们留言</div>
            <form id="ct_btn" method="post" action="" class="form-box wow fadeInUp" data-wow-delay="300ms">
                <div class="line has-star">
                    <input type="text" placeholder="姓名" name="realname" id="realname">
                </div>
                <div class="line has-star">
                    <input type="text" placeholder="公司名称" name="company" id="company">
                </div>
                <div class="line has-star">
                    <input type="text" placeholder="电话" name="tel" id="tel">
                </div>
                <div class="line">
                    <input type="text" placeholder="邮箱" name="email" id="email">
                </div>
                <div class="line has-text has-star">
                    <textarea name="content" id="content" cols="30" rows="10" placeholder="留言内容"></textarea>
                </div>
                <div class="code-box">
                    <div class="line has-star">
                        <input type="text" placeholder="验证码" name="verify" id="verify">
                    </div>
                    <div class="img-box">
                        <img id="verifyImgs" src="{:addon_url('wwh/index/verify')}" alt="验证码" title="看不清楚?换一张" onclick="this.src='{:addon_url('wwh/index/verify')}?seed='+Math.random()"/>
                    </div>
                </div>
                <button class="msg-btn" type="button" onClick="ct_btn()">留言提交</button>
            </form>
        </div>

        </div>
    </div>
</div>

<!--底部-->
{include file="footer" /}
<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=HFj5n9bYddGgCa5ZPNkrmIUsNrIfDlom"></script>
<script>
    $('.nav_pc .first, .nav_pc .second').on('mouseenter mouseleave', function () {
        $(this).children('ul').stop().slideToggle()
    });

    function loadmap(){
        // 百度地图API功能
        var map = new BMap.Map("map");
        var point = new BMap.Point({$config.map_zb});
        var myIcon = new BMap.Icon("__CDN__/assets/addons/wwh/images/zb.png", new BMap.Size(25,25), {
            // 指定定位位置。
            // 当标注显示在地图上时，其所指向的地理位置距离图标左上
            // 角各偏移10像素和25像素。您可以看到在本例中该位置即是
            // 图标中央下端的尖角位置。
            // 设置图片偏移。
            // 当您需要从一幅较大的图片中截取某部分作为标注图标时，您
            // 需要指定大图的偏移位置，此做法与css sprites技术类似。
            imageOffset: new BMap.Size(0, 0)   // 设置图片偏移
        });
        map.enableScrollWheelZoom();   //启用滚轮放大缩小，默认禁用
        map.enableContinuousZoom();    //启用地图惯性拖拽，默认禁用
        map.centerAndZoom(point, 16);   //地图层级
        var marker = new BMap.Marker(point,{icon: myIcon});  // 创建标注
        map.addOverlay(marker);               // 将标注添加到地图中
        var infohtml = '<div class="map-info"><div class="info"><p class="t1">{$config.map_mc}</p><p class="t2">{$config.map_dz}</p></div><a class="gps-box" href="http://api.map.baidu.com/marker?location={$config.map_dzq}&title=我的位置&content={$config.map_mc}&output=html" target="_blank"><img src="__CDN__/assets/addons/wwh/images/20200813153230.png"><p  class="tt">到这去</p></div>'
        var label = new BMap.Label(infohtml,{offset:new BMap.Size(-80,-130)});
        marker.setLabel(label);
    }
    loadmap();

    //客户留言
    function ct_btn(){
        var realname=$.trim($("#realname").val());
        var company=$.trim($("#company").val());
        var tel=$.trim($("#tel").val());
        var email=$.trim($("#email").val());
        var content=$.trim($("#content").val());
        var verify=$.trim($("#verify").val());
        if(realname==''){alert('请填写姓名');return false;}
        if(tel==''){alert('请填写电话');return false;}
        var reg=/(^(\d{3,4}-)?\d{7,8})$|(1[3|4|5|7|8|9]\d{9})$/;
        if(!reg.test(tel)){alert('请填写有效的电话');return false;}
//        if(email==''){alert('请填写邮箱');return false;}
//        var myreg =/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
//        if(!myreg.test(email)){alert('请填写有效的邮箱');return false;}
        if(company==''){alert('请填写公司名称');return false;}
        if(content==''){alert('请填写内容');return false;}
        if(verify==''){alert('请填写验证码');return false;}

        //重载验证码
        function fleshVerify(){
            $('#verifyImgs').attr('src','{:addon_url('wwh/index/verify')}?seed='+Math.random());
        }

        $.ajax({
            url: "{:addon_url('wwh/index/message')}",
            type: "POST",
            data: {'realname':realname,'company':company,'tel':tel,'email':email,'content':content,'verify':verify},
            async: true,
            dataType: "json",
            success: function(mes){
                if(mes==1){
                    alert("提交成功");
                    window.location.reload();
                }else if(mes==2){
                    alert("请检查后台邮件配置|插件邮箱配置");
                    fleshVerify();
                }else {
                    alert("验证码错误，请重试");
                }
            }
        });
    }
</script>
</body>
</html>
